<ul class="cms_sidebarmenu">
<li>&nbsp;
<ul class="cms_sidebarsubmenu" >
<li><a href="/cms/html/index.php?viewModeSent=0&amp;fileNo=13">Home</a></li>
<li><a href="./index.php?fileNo=14">Change P/word</a></li>
</ul>
</li>
</ul>
<?php

//	include_once("cmsConfig.php");
	
	$authInfo = extractObjectWithKeyFromArray('authInfo', $_SESSION);
	
	
	if ($_SESSION['viewMode'] === CMS_ADMIN_MODE ) {
?>
<div class="cms_sidebar_menudivider"><img src="/images/spacer.gif" height="1" width="1" /></div>
<ul class="cms_sidebarmenu">
	<li>Admin
		<ul class="cms_sidebarsubmenu">
<?					//need to possibly modify this to allow users in admin to add/edit grgoups
				
					if (permissionForMode($authInfo->uid, CMS_ADMIN_MODE,$db)) {
						print <<< EOD
<li><a href="./index.php?fileNo=7">Users</a></li>
<li><a href="./index.php?fileNo=8">Groups</a></li>
EOD;
					}

					if ($authInfo->usertype === '0' ) {
						print <<< EOD
<li><a href="./index.php?fileNo=6">Forms</a></li>
<li><a href="./index.php?fileNo=16">Import</a></li>
<li><a href="./index.php?fileNo=15">Export</a></li>
EOD;
					}
?>
		</ul>
	</li>
	</ul>
	
<?					
	}

    $altAdd = "Add New Record";
    $altList = "List Current Content";
	$db = extractObjectWithKeyFromArray('db', $GLOBALS);
	$formDescriptorTableWriter = new CmsTableWriter( "formdescriptor", $db );//where the fuck does the db ... not come from//
	$formDescriptorTableWriter->resetCustomIterator(" WHERE contentmodule=1 AND activemodule=1 AND sidebarmodule=1  AND (" . $_SESSION['viewMode'] . " & modeaccess)");

	if ($formDescriptorTableWriter->db->numRows() > 0) {	
?>
<div class="cms_sidebar_menudivider"><img src="/images/spacer.gif" height="1" width="1" /></div>
<ul class="cms_sidebarmenu">
	<li>Modules
		<ul class="cms_sidebarsubmenu">
<?
			while ($row = $formDescriptorTableWriter->nextItem()) {
				if (viewFormAuth($authInfo, $row, null, $db)) {
					print <<< EOD
	              <li><a href="./index.php?fileNo=1&formid=$row->formid&sorts=clear&direction=clear">$row->formname </a></li>
EOD;
				}
			}
			foreach ($MENU_MODULES_ITEMS as $name=>$link) {
				echo "<li><a href=\"".$link."\">".$name."</a></li>\n";
			}
			if($_SESSION['viewMode'] == PERMISSION_MAILOUT)
				echo "<li><a href=\"./index.php?fileNo=115\">Bounce Fwd</a></li>\n";
?>
		</ul>
		
	</li>
</ul>
<?
	}


	$query = " Where contentmodule=0 AND activemodule=1 AND sidebarmodule=1 AND (" . $_SESSION['viewMode'] . " & modeaccess) ";
	$formDescriptorTableWriter = new CmsTableWriter( "formdescriptor", $db );
	$formDescriptorTableWriter->resetCustomIterator($query);

	if ( $formDescriptorTableWriter->db->numRows()>0 ){

?>
<div class="cms_sidebar_menudivider"> <img src="/images/spacer.gif" height="1" width="1" /></div>
<ul class="cms_sidebarmenu">	
	<li >Code Tables
		<ul class="cms_sidebarsubmenu">
<?
		while ($row = $formDescriptorTableWriter->nextItem()) {
			if (viewFormAuth($authInfo, $row, null, $db)) {
				print <<< EOD
              <li><a href="./index.php?fileNo=1&formid=$row->formid&sorts=clear&direction=clear"> $row->formname </a></li>
EOD;
			} else {
				echo $row->formname;
			} 
		}
		foreach ($MENU_CODETABLES_ITEMS as $name=>$link) {
			echo "<li><a href=\"".$link."\">".$name."</a></li>\n";
		}

?>
		</ul>
	</li>	
</ul>
<?
	}
?>
<?
//*************Stuff Added by Rochelle 2007-05-16**************************
	if ($_SESSION['viewMode'] == PERMISSION_INTRANET) { //Intranet - quick links
?>
<div class="cms_sidebar_menudivider"><img src="/images/spacer.gif" height="1" width="1" /></div>
<ul class="cms_sidebarmenu">
  <li >CMS Quick Links
		<ul class="cms_sidebarsubmenu">
	      <li><a href="/cms/html/index.php?fileNo=164&formid=193&sorts=clear&direction=clear">CMS Quick Links</a></li>
		  <li><a href="/cms/html/index.php?fileNo=165&formid=194&sorts=clear&direction=clear">CMS Quick Links Categories</a></li>
		</ul>
	</li>
</ul>
<?
	}
//*************End of Stuff Added by Rochelle 2007-05-16**************************
?>




<div class="cms_sidebar_menudivider"> <img src="/images/spacer.gif" height="1" width="1" /></div>
<ul class="cms_sidebarmenu">	
	<li>&nbsp;
		<ul class="cms_sidebarsubmenu">
			<li><a href="./cmsLogout.php">Logout</a></li>
		</ul>
	</li>
</ul>
